
*{
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}
.game{
    border: 3px solid green;
    height: 500px;
    width: 400px;
    margin-left: 35%;
}
.user{
    background-color: lightgreen;
    width: 100px;
    height: 20px;
    left: 150px;
    position: relative;
}
.ball{
    width: 20px;
    height: 20px;
    background-color: green;
    border-radius: 50%;
    position: relative;
    top:460px;
}
.animation{
    animation:slideY 5s infinite linear;
}
.balldiv{
    width: 400px;
    height: 480px;
    position: relative;
    margin: auto;
    animation:slideX 1.0284s infinite linear;
}
@keyframes slideX{
    0%{left:0px;}
    50%{left:380px;}
    100%{left:0px;}
}
@keyframes slideY{
    0%{top:460px;}
    50%{top:0px;}
    100%{top:460px;}
}
.left{
    z-index: 100;
    width: 200px;
    position: absolute;
    height: 500px;
}
.right{
    z-index: 100;
    width: 200px;
    margin-left: 200px;
    position: absolute;
    height: 500px;
}
#restart{
    font-size: 2rem;
    padding: 0.5rem 2rem;
    border: 3px solid green;
    border-radius: 0.3rem;
    margin: 1rem auto;
    margin-left: 43%;
    color:green;
}
#restart:hover{
    background-color: green;
    color: white;
    cursor: pointer;
}

@media only screen and (max-width: 399px){
   .game,.left,.right{
        height: 400px;
    } 
    @keyframes slideY{
        0%{top:360px;}
        50%{top:0px;}
        100%{top:360px;}
    }
    .ball{
        top:360px;
    }
    .balldiv{
        height: 380px;
    }
}